package zhoufu.sz.sanxiao_check.ui.check;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import zhoufu.sz.sanxiao_check.R;
import zhoufu.sz.sanxiao_check.databinding.FragmentFireCheckMainBinding;
import zhoufu.sz.sanxiao_check.ui.fragment.BaseFragment;
import zhoufu.sz.sanxiao_check.ui.fragment.FireSafetyFragment;

/**
 * User:RCP
 * email:ruancaipu@gmail.com
 * Date:2016/7/30
 */
public class FireCheckMainFragment extends BaseFragment
{

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater,
            @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
    {
        FragmentFireCheckMainBinding _binding = DataBindingUtil
                .inflate(inflater, R.layout.fragment_fire_check_main, container, false);
        _binding.setOnClickListener(this);
        return _binding.getRoot();
    }

    @Override
    public void onClick(View v)
    {
        super.onClick(v);
        CheckMainActivity mAct = (CheckMainActivity) getmAct();
        switch (v.getId())
        {
            case R.id.mTvFireCheck:
                mAct.addFragmentWithStage(R.id.main_fram,
                        FireSafetyFragment.newInstance(mAct.mInfoModel.getSID()));
                break;
            case R.id.mTvFireCheckBook:
                mAct._navigator.startCheckHistory(mAct, mAct.mInfoModel.getSID());
                break;
        }
    }
}
